﻿namespace Service.Framework.OperationLog
{
    /// <summary>
    /// 业务日志
    /// </summary>
    public class OperationLogDto
    {
        public OperationLogDto()
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="apiMethod"></param>
        /// <param name="apiPath"></param>
        /// <param name="elapsedMilliseconds"></param>
        /// <param name="params"></param>
        /// <param name="result"></param>
        /// <param name="browserInfo"></param>
        /// <param name="ip"></param>
        /// <param name="name"></param>
        public OperationLogDto(string msg, string apiMethod, string apiPath, long elapsedMilliseconds, string @params, string result, string browserInfo, string ip, string name, OperationLogType type, string userId, string clientId, string devicePlatform = "", string deviceId = "", string version = "", string backupField1 = "", string backupField2 = "", string backupField3 = "")
        {
            Msg = msg;
            ApiMethod = apiMethod;
            ApiPath = apiPath;
            ElapsedMilliseconds = elapsedMilliseconds;
            Params = @params;
            Result = result;
            BrowserInfo = browserInfo;
            Ip = ip;
            Name = name;
            CreateTime = DateTime.Now;
            Type = type;
            UserId = userId;
            ClientId = clientId;
            DevicePlatform = devicePlatform;
            DeviceId = deviceId;
            Version = version;
            BackupField1 = backupField1;
            BackupField2 = backupField2;
            BackupField3 = backupField3;
        }

        /// <summary>
        /// 日志内容
        /// </summary>
        public string Msg { get; private set; }

        /// <summary>
        /// 请求方法
        /// </summary>
        public string ApiMethod { get; private set; }

        /// <summary>
        /// 请求地址
        /// </summary>
        public string ApiPath { get; private set; }

        /// <summary>
        /// 执行耗时
        /// </summary>
        public long ElapsedMilliseconds { get; private set; }

        /// <summary>
        /// 参数
        /// </summary>
        public string Params { get; private set; }

        /// <summary>
        /// 返回结果
        /// </summary>
        public string Result { get; private set; }

        /// <summary>
        /// 
        /// </summary>
        public string BrowserInfo { get; private set; }

        /// <summary>
        /// 请求ip
        /// </summary>
        public string Ip { get; private set; }

        /// <summary>
        /// 日志名称
        /// </summary>
        public string Name { get; private set; }


        /// <summary>
        /// 日志类型
        /// </summary>
        public OperationLogType Type { get; private set; }

        /// <summary>
        /// 日志创建时间
        /// </summary>
        public DateTime CreateTime { get; private set; }

        /// <summary>
        /// 操作人
        /// </summary>
        public string UserId { get; private set; }


        /// <summary>
        /// 操作人客户端
        /// </summary>
        public string ClientId { get; private set; }



        /// <summary>
        /// 设备客户端
        /// </summary>
        public string DevicePlatform { get; private set; }



        /// <summary>
        /// 设备编号
        /// </summary>
        public string DeviceId { get; private set; }

        /// <summary>
        /// 版本号
        /// </summary>
        public string Version { get; set; }


        public string BackupField1 { get; set; }

        public string BackupField2 { get; set; }

        public string BackupField3 { get; set; }

    }
}
